package cn.ljz.boke.controller;

import cn.ljz.boke.pojo.Logs;
import cn.ljz.boke.service.BlogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class BlogsController {
    @Autowired
    private BlogsService blogsService;


    @RequestMapping("index")
    public String index() {
        return "index";
    }

    @PostMapping("/showIndexLogs")
    @ResponseBody
    public List<Logs> showIndexLogs() {
        List<Logs> logs = blogsService.showIndexLogs();
        return logs;
    }


}
